package com.future.lottie.activity;

import android.text.Editable;
import android.text.TextUtils;
import android.view.LayoutInflater;

import com.future.lottie.audio.TextToSpeechMgr;
import com.future.lottie.base.BaseActivity;
import com.future.lottie.databinding.ActivityAudio2Binding;

public class AudioActivity2 extends BaseActivity<ActivityAudio2Binding> {



    @Override
    protected ActivityAudio2Binding createViewBinding(LayoutInflater inflater) {
        return ActivityAudio2Binding.inflate(inflater);
    }

    @Override
    protected void initView() {
        TextToSpeechMgr.getInstance().init(this);


        mViewBinding.btnPlay.setOnClickListener(v -> {
            Editable text = mViewBinding.edt.getText();
            String string = text.toString();
            if (!TextUtils.isEmpty(string)) {
                TextToSpeechMgr.getInstance().playText(string);
            }

        });
    }

    @Override
    protected void initData() {

    }
}